//Describe abstract class called Shape which has three subclasses say Triangle, Rectangle, and Circle.
// Define one method area() in the abstract class and override this area() in these three subclasses to calculate for specific object i.e.
// area() of Triangle subclass should calculate area of triangle etc. Same for Rectangle and Circle


abstract class Shape {
    abstract double area();
}

class Triangle extends Shape {
    private double base;
    private double height;

    public Triangle(double base, double height) {
        this.base = base;
        this.height = height;
    }

    @Override
    double area() {
        return 0.5 * base * height;
    }
}

class Rectangle extends Shape {
    private double width;
    private double height;

    public Rectangle(double width, double height) {
        this.width = width;
        this.height = height;
    }

    @Override
    double area() {
        return width * height;
    }
}

class Circle extends Shape {
    private double radius;

    public Circle(double radius) {
        this.radius = radius;
    }

    @Override
    double area() {
        return Math.PI * radius * radius;
    }
}

public class ShapeExample {
    public static void main(String[] args) {
        Shape triangle = new Triangle(5, 10);
        Shape rectangle = new Rectangle(8, 6);
        Shape circle = new Circle(4);

        System.out.println("Area of Triangle: " + triangle.area());
        System.out.println("Area of Rectangle: " + rectangle.area());
        System.out.println("Area of Circle: " + circle.area());
    }
}
